define(function(require) {
	var $ = require("jquery");
//	var justep = require("$UI/system/lib/justep");
	require("$UI/ls_shaomiao/myscripts/SystemConfig");
//	var fn = require("$UI/ls_common/fn");
	var Model = function() {
		this.callParent();
	};

	Model.prototype.modelParamsReceive = function(event) {
		console.log("modelParamsRecive()");
		this.CustomerApi();
	};
	Model.prototype.CustomerApi = function() {
		console.log("CustomerApi()");
		var api_url = window.app.base_url + window.app.CustomerApi;
		var data = {};
		data.username = window.app.username;
		data.password = window.app.password;
		data.CtmType= window.app.CtmType;
		var self = this;
		$.ajax({
			type : "POST",
			url : require.toUrl(api_url),
			data : {
				'data' : JSON.stringify(data)
			},
			dataType : 'json',
			success : function(res) {
				console.log(res);
				window.app.CustomerApi_ret = res;
				self.comp("FenXiaoShangData").clear();
				self.comp("FenXiaoShangData").loadData(res);
				return;
			},
			error : function(e) {
				return;
			}
		});
	};
	Model.prototype.Add_ButtonClick = function(event){
		console.log("Add_ButtonCLick()");
		this.getParent().comp("AddSubagent_Window").load("$UI/ls_shaomiao/AddSubagent.w");
		this.getParent().comp("Main_Contents").to("AddSubagent_Content");
	};
	return Model;
});